from pyecharts import options as opts
from pyecharts.charts import Line
from pyecharts.globals import ThemeType
import pandas as pd
df=pd.read_excel("2022年某店铺3个分店销售额.xlsx")
x=df["月份"].tolist()
y=df["第三分店"]
line=Line(init_opts=opts.InitOpts(width="800px",height="400px",theme=ThemeType.VINTAGE,page_title="折线图"))
line.add_xaxis(xaxis_data=x)
line.add_yaxis(series_name="第三分店",y_axis=y)
line.set_global_opts(title_opts=opts.TitleOpts(title='2022年某店铺3个分店销售额.xlsx',pos_left="center"),yaxis_opts=opts.AxisOpts(name='销售额(万元)',name_location='center',name_gap=35,min_=18),xaxis_opts=opts.AxisOpts(name='月份',name_location='cemter',name_gap=35),
                     legend_opts=opts.LegendOpts(pos_right='10%',pos_top='8%'))
line.render('line.html')